import React,{Component} from 'react';
import {HashRouter as Router,Route,NavLink,Redirect,Switch,WithRouter, withRouter} from 'react-router-dom'
import loadable from '../util/loadable'
const HomeBot = loadable(()=>import('./HomeBot'))
const weitao = loadable(()=>import('./weitao'))
const xiaoxi = loadable(()=>import('./xiaoxi'))
const gouwuche = loadable(()=>import('./gouwuche'))
const wode = loadable(()=>import('./wode'))
class Mytaobao extends Component{
    constructor(){
        super();
        this.state={
        }
    }
    componentDidMount(){
    }
    render(){
        return(
            <Router>
                <div className="Box">
                <div className="top">
                    <div className="header">
                        <div className="header-lef">
                            <dl>
                                <dt><img src="/img/2.png"/></dt>
                                <dd>扫一扫</dd>
                            </dl>
                        </div>
                        <div className="header-main">
                            <div className="main-box">
                                <div className="main-box-lef">
                                    <img src="/img/5.png"/>
                                </div>
                                <input type="text" placeholder="请输入想要查找的宝贝"/>
                                <div className="main-box-rig">
                                    <img src="/img/4.png"/>
                                </div>
                            </div>
                        </div>
                        <div className="header-rig">
                            <dl>
                                <dt><img src="/img/3.png"/></dt>
                                <dd>会员码</dd>
                            </dl>
                        </div>
                    </div> 
                    </div>
                    <div className="main"> 
                            <Switch>
                                <Route path="/Mytaobao/home" component={HomeBot}></Route>
                                <Route path="/Mytaobao/weitao" component={weitao}></Route>
                                <Route path="/Mytaobao/xiaoxi" component={xiaoxi}></Route>
                                <Route path="/Mytaobao/gouwuche" component={gouwuche}></Route>
                                <Route path="/Mytaobao/wode" component={wode}></Route>
                                <Redirect to="/Mytaobao/home/home"></Redirect>
                            </Switch>
                    </div>
                    <div className="footer">
                        <div>
                            <NavLink
                            to="/Mytaobao/home"
                            activeStyle={{
                                color:'white'
                            }}
                            >首页</NavLink>
                        </div>
                        <div>
                        <NavLink
                        to="/Mytaobao/weitao"
                         activeStyle={{
                                color:'white'
                            }}
                        >微淘</NavLink>
                        </div>
                        <div>
                        <NavLink
                        to="/Mytaobao/xiaoxi"
                        activeStyle={{
                            color:'white'
                        }}
                        >消息</NavLink>
                        </div>
                        <div>
                        <NavLink
                        to="/Mytaobao/gouwuche"
                         activeStyle={{
                                color:'white'
                            }}
                        >购物车</NavLink>
                        </div>
                        <div>
                        <NavLink
                        to="/Mytaobao/wode"
                        activeStyle={{
                            color:'white'
                        }}
                        >我的淘宝</NavLink>
                        </div>
                    </div>
                </div>
                
                
           </Router>
        )
    }
}
export default withRouter(Mytaobao)